package com.sskj.gocoin.p.activity;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.gocoin.m.HttpConfig;
import com.sskj.gocoin.m.bean.HttpData;
import com.sskj.gocoin.m.bean.ShareInfo;
import com.sskj.gocoin.m.http.JsonCallBack;
import com.sskj.gocoin.p.base.BasePresenter;
import com.sskj.gocoin.utils.ToastUtil;
import com.sskj.gocoin.v.activity.ShareActivity;

public class SharePresenter extends BasePresenter<ShareActivity> {

    public void getShareInfo() {
        OkGo.<HttpData<ShareInfo>>get(HttpConfig.BASE_URL + HttpConfig.SHAREINFO)
                .execute(new JsonCallBack<HttpData<ShareInfo>>(this) {
                    @Override
                    protected void _onSuccess(Response<HttpData<ShareInfo>> response) {
                        if (response.body().status == 200) {
                            mView.setInfo(response.body().getData());
                        }else{
                            ToastUtil.showShort(response.body().getMsg());
                        }
                    }
                });
    }

}
